import { defineConfig } from 'vite'
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
// import ReactivityTransform from '@vue-macros/reactivity-transform/vite';
import eslint from 'vite-plugin-eslint'

export default defineConfig({
  plugins: [
    vue(),
    // ReactivityTransform(), // 启用响应式语法糖 $ref ...
    // 解决 `import { ref , reactive ..... } from 'vue'` 大量引入的问题
    AutoImport({
      imports: ['vue', 'vue-router']
    }),
    eslint({ lintOnStart: true, cache: false }) // 项目运行时进行eslint检查]
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})
